using System;
using Vici.Mvc;

namespace Demo.ViciMvc
{
    // We create this base controller class to allow type-safe access to the Session object,
    // which is derived from BaseSession

    public class BaseController : Controller
    {
        public new DemoSession Session { get { return (DemoSession) Controller.Session; } }

        [BeforeAction]
        public void RegisterJavascriptFramework()
        {
            View.RegisterJavascriptInclude("jQuery", true, "~/Content/JavaScript/jquery-1.3.2.min.js");

            ViewData.AddFunction("GetUserList",typeof (DataService), "GetAllUsers");
        }
    }
}
